package org.flycloud.web.login.service;

import org.flycloud.web.decoupling.RemoteControllerFactory;
import org.flycloud.web.platform.api.IPlatformController;
import org.flycloud.web.sso.common.ILoginService;
import org.flycloud.web.sso.common.UserSession;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Service;

@Service
@DependsOn({ "remoteControllerFactory" })
public class LoginService implements ILoginService {

	private IPlatformController platform = (IPlatformController) RemoteControllerFactory
			.getInstance(IPlatformController.class);

	@Override
	public UserSession login(String username, String password) {
		UserSession us = platform.login(username, password);
		System.out.println("username:" + username);
		return us;
	}

}
